[ClangImporter] Import underlying Clang locations#39701
Closed
bnbarham wants to merge 1 commit intoswiftlang:mainfrom
Closed
[ClangImporter] Import underlying Clang locations#39701bnbarham wants to merge 1 commit intoswiftlang:mainfrom
bnbarham wants to merge 1 commit intoswiftlang:mainfrom
Conversation
Rather than producing diagnostics with unknown locations and generated Swift code, import the underlying header locations from Clang instead. Resolves rdar://84127604
bnbarham
commented
Oct 12, 2021
Comment on lines
+93
to
+94
| // TODO: The LineTable is obstensibly part of the "internals", should we be | ||
| // relying on it here? |
Contributor
Author
There was a problem hiding this comment.
entries() is a function I've added on the LLVM side so I'd need to merge that before this one, but I'd like some opinions on this before doing that.
I'd like to avoid creating a virtual file for every line within a line directive. The line table should be complete in all cases other than diagnostics, so this seemed like the easiest option - but if anyone has a better idea I'd be happy to implement that instead :)
bnbarham
commented
Oct 12, 2021
| func foo(_: SwiftConstrGenericNameAlias<String>) { | ||
| // expected-error@-1 {{'SwiftConstrGenericNameAlias' requires that 'String' inherit from 'NSNumber'}} | ||
| // expected-note@-2 {{requirement specified as 'T' : 'NSNumber' [with T = String]}} | ||
| // FIXME-note@-2 {{requirement specified as 'T' : 'NSNumber' [with T = String]}} |
Contributor
Author
There was a problem hiding this comment.
There's a few tests like this - should I just switch over to using FileCheck? May be worth adding some more tests to explicitly test this case as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than producing diagnostics with unknown locations and generated
Swift code, import the underlying header locations from Clang instead.
Resolves rdar://84127604